<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>修改密码</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!--标准mui.css-->
    <link rel="stylesheet" href="__PUBLIC__/css/mui.min.css">

    <!--App自定义的css-->
    <link rel="stylesheet" href="__PUBLIC__/css/user.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/app.css"/>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script src="__PUBLIC__/layer_mobile/layer.js"></script>
</head>
<body>

<header class="mui-bar mui-bar-nav">
    <a onclick="dump('{:U('ZhangHuAnQuan')}')" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">修改密码</h1>
    <script>
        //url跳转
        function dump(url) {
            location.href=url
        }
    </script>
</header>
<div class="mui-content">
    <form id='login-form' class="mui-input-group">
        <div class="mui-input-row h50">
            <label>旧密码</label>
            <input id='account' type="text" class="mt5 mui-input-clear mui-input" placeholder="请输入旧密码">
        </div>
        <div class="mui-input-row h50">
            <label>新密码</label>
            <input id="newpassword"  type="password" class="mt5 mui-input-clear mui-input" placeholder="请输入新密码">
        </div>
        <div class="mui-input-row h50">
            <label>确认密码</label>
            <input id="okpassword"   type="password" class="mt5 mui-input-clear mui-input" placeholder="请再次确认密码">
        </div>
    </form>
    <button id="button" type="button" class=" mui-btn-sz">确认修改</button>
</div>
</body>
</html>
<script>
    $(function () {
        $('#button').click(function () {
            var account = $('#account').val()
            var newpassword = $('#newpassword').val()
            var okpassword = $('#okpassword').val()
            if(account == '' )
            {
                //信息框
                layer.open({
                    content: '请输入旧密码'
                    ,btn: '我知道了'
                });
                return false
            }else if(newpassword == '')
            {
                //信息框
                layer.open({
                    content: '请输入新密码'
                    ,btn: '我知道了'
                });
                return false
            }else if(okpassword == '')
            {
                //信息框
                layer.open({
                    content: '请输入确认密码'
                    ,btn: '我知道了'
                });
                return false
            }
            if(newpassword != okpassword)
            {
                //信息框
                layer.open({
                    content: '新密码确认密码不一致'
                    ,btn: '我知道了'
                });
                return false
            }
            $.post("{:U('updatePassword1')}",{Passwd:account,PasswdNew:okpassword},function (rel) {
                //信息框
                layer.open({
                    content: rel.msg
                    ,btn: '我知道了'
                });
                return false
            })
        })
    })
</script>
